package test2;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
class Solution1 {
    public int missingNumber(int[] nums) {
        Arrays.sort(nums);
        int count = 0;
        int len = nums.length;
        while(count<len)
        {
            if(nums[count]!=count)
                return count;
        }
        return len;
    }
}

public class demo1 {




        public static void main(String[] args) {
            int[] num = new int[]{0,2,1,3,5,6};
            Solution1 s1 = new Solution1();
            int num1 = s1.missingNumber(num);
            System.out.println(num1);
        }

}
